﻿using System;

namespace Borg
{
    [Flags]
    public enum QualificationState : long
    {
        None = 0L,
        QualificationMissing = 1L,
        EventHandlerQualificationMissing = 2L,
        ContractNameAlreadyExists = EventHandlerQualificationMissing | QualificationMissing,
        ContractAssemblyCouldNotBeLoaded = 4L,
        ContractNoSlotDefinitions = ContractAssemblyCouldNotBeLoaded | QualificationMissing,
        SlotDefinitionContractNotQualified = ContractAssemblyCouldNotBeLoaded | EventHandlerQualificationMissing,
        SlotDefinitionAlreadyExists = SlotDefinitionContractNotQualified | QualificationMissing,
        SlotDefinitionTypeNotInContractAssembly = 8L,
        ParamDefinitionSlotDefinitionNotQualified = SlotDefinitionTypeNotInContractAssembly | QualificationMissing,
        ParamDefinitionAlreadyExists = SlotDefinitionTypeNotInContractAssembly | EventHandlerQualificationMissing,
        ParamDefinitionTypeNotFound = ParamDefinitionAlreadyExists | QualificationMissing,
        ParamDefinitionDefaultValueNotAssignable = SlotDefinitionTypeNotInContractAssembly | ContractAssemblyCouldNotBeLoaded,
        TagDefinitionSlotDefinitionNotQualified = ParamDefinitionDefaultValueNotAssignable | QualificationMissing,
        TagDefinitionAlreadyExists = ParamDefinitionDefaultValueNotAssignable | EventHandlerQualificationMissing,
        TagDefinitionTypeNotFound = TagDefinitionAlreadyExists | QualificationMissing,
        TagDefinitionDefaultValueNotAssignable = 16L,
        PluginNameAlreadyExists = TagDefinitionDefaultValueNotAssignable | QualificationMissing,
        PluginAssemblyCouldNotBeLoaded = TagDefinitionDefaultValueNotAssignable | EventHandlerQualificationMissing,
        PluginNoExtensions = PluginAssemblyCouldNotBeLoaded | QualificationMissing,
        ExtensionPluginNotQualified = TagDefinitionDefaultValueNotAssignable | ContractAssemblyCouldNotBeLoaded,
        ExtensionNameAlreadyExists = ExtensionPluginNotQualified | QualificationMissing,
        ExtensionTypeNotInPluginAssembly = ExtensionPluginNotQualified | EventHandlerQualificationMissing,
        ExtensionInvalidConstructor = ExtensionTypeNotInPluginAssembly | QualificationMissing,
        ExtensionNoPlugs = TagDefinitionDefaultValueNotAssignable | SlotDefinitionTypeNotInContractAssembly,
        PlugExtensionNotQualified = ExtensionNoPlugs | QualificationMissing,
        PlugNameAlreadyExists = ExtensionNoPlugs | EventHandlerQualificationMissing,
        PlugSlotDefinitionNotFound = PlugNameAlreadyExists | QualificationMissing,
        PlugInterfaceNotImplemented = ExtensionNoPlugs | ContractAssemblyCouldNotBeLoaded,
        PlugParamMissing = PlugInterfaceNotImplemented | QualificationMissing,
        PlugParamNotQualified = PlugInterfaceNotImplemented | EventHandlerQualificationMissing,
        ParamPlugNotQualified = PlugParamNotQualified | QualificationMissing,
        ParamNameAlreadyExists = 32L,
        ParamNotAssignable = ParamNameAlreadyExists | QualificationMissing,
        SlotExtensionNotQualified = ParamNameAlreadyExists | EventHandlerQualificationMissing,
        SlotNameAlreadyExists = SlotExtensionNotQualified | QualificationMissing,
        SlotSlotDefinitionNotFound = ParamNameAlreadyExists | ContractAssemblyCouldNotBeLoaded,
        ExtensionOnCreatedMethodNotFound = SlotSlotDefinitionNotFound | QualificationMissing,
        ExtensionOnDestroyedMethodNotFound = SlotSlotDefinitionNotFound | EventHandlerQualificationMissing,
        PlugOnPluggedMethodNotFound = ExtensionOnDestroyedMethodNotFound | QualificationMissing,
        PlugOnUnpluggedMethodNotFound = ParamNameAlreadyExists | SlotDefinitionTypeNotInContractAssembly,
        PlugOnTaggedMethodNotFound = PlugOnUnpluggedMethodNotFound | QualificationMissing,
        PlugOnUntaggedMethodNotFound = PlugOnUnpluggedMethodNotFound | EventHandlerQualificationMissing,
        SlotOnOpenedMethodNotFound = PlugOnUntaggedMethodNotFound | QualificationMissing,
        SlotOnPluggedMethodNotFound = PlugOnUnpluggedMethodNotFound | ContractAssemblyCouldNotBeLoaded,
        SlotOnTaggedMethodNotFound = SlotOnPluggedMethodNotFound | QualificationMissing,
        SlotOnClosedMethodNotFound = SlotOnPluggedMethodNotFound | EventHandlerQualificationMissing,
        SlotOnUnpluggedMethodNotFound = SlotOnClosedMethodNotFound | QualificationMissing,
        SlotOnUntaggedMethodNotFound = ParamNameAlreadyExists | TagDefinitionDefaultValueNotAssignable,
    }
}

